/*
 * bomb.h
 *
 *  Created on: 2013
 *      Author: Eddy Zogbo and Moncef Sbay
 */

#ifndef BOMB_H_
#define BOMB_H_

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
#include <SDL_image.h>

#include "../include/constant.h"
#include "../include/player.h"
#include "../include/monster_list.h"
#include "../include/map.h"

enum e_state {
	time_1 = 0, time_2, time_3, time_4, time_5
};

typedef struct s_bomb s_bomb;
typedef struct s_bomb * t_bomb;
typedef struct monster_list monster_list;
typedef struct s_monster * t_monster;
typedef struct s_map* t_map;
typedef struct s_player * t_player;
typedef struct monster_list *t_monster_list;

//Creates a new bomb
extern t_bomb set_bomb(int x, int y, t_player player);

//display the state of the bomb
extern void state_display(t_bomb bomb, enum e_state state);

//check if the bomb has exploded
extern int has_exploded(t_bomb bomb);

//Returns the bomb power
extern int bomb_get_power(t_bomb bomb);

//spread the bomb and check the effect
extern void bomb_spreading(t_bomb bomb, t_map map, t_player player,
		t_monster_list monster_list, SDL_Surface *screen);
void bomb_spreading1(t_bomb bomb, t_map map, t_player player,
		t_monster_list monster_list, SDL_Surface *screen);

//check if the bomb has exploded and can explode in some location
extern void explode_bomb(t_bomb bomb);
extern int bomb_can_explode(t_map map, int x, int y);
// Display the player on the screen
extern void bomb_display(t_bomb bomb, t_map map, t_player player,
		t_monster_list monster_list, SDL_Surface *screen);

#endif /* BOMB_H_ */

